﻿
using Microsoft.Xna.Framework;
using PolyVoxCore;

namespace DKE_Kinect.Entwicklung.Core
{
	/// <summary>
	/// Stellt Projektspezifische Konvertierung bereit.
	/// </summary>
	internal static class Convert
	{
		/// <summary>
		/// Konvertiert einen PolyVoxCore.Vector3DFloat in einen Microsoft.Xna.Framework.Vector3.
		/// </summary>
		/// <param name="_vec">Der zu konvertierende PolyVoxCore.Vector3DFloat.</param>
		/// <returns></returns>
		internal static Vector3 Vector3DFloatToVector3 (Vector3DFloat _vec)
		{
			return new Vector3(_vec.getX(), _vec.getY(), _vec.getZ());
		}

		/// <summary>
		/// Konvertiert einen Microsoft.Xna.Framework.Vector2 in einen Microsoft.Xna.Framework.Point.
		/// </summary>
		/// <param name="Vector">Der zu konvertierende Microsoft.Xna.Framework.Vector2.</param>
		/// <returns></returns>
		internal static Point Vector2ToPoint (Vector2 Vector)
		{
			return new Point((int)Vector.X, (int)Vector.Y);
		}

		/// <summary>
		/// Konvertiert einen Microsoft.Xna.Framework.Vector3 in einen Microsoft.Xna.Framework.Point, indem die Z-Komponente ignoriert wird.
		/// </summary>
		/// <param name="Vector">Der zu konvertierende Microsoft.Xna.Framework.Vector3.</param>
		/// <returns></returns>
		internal static Point Vector3ToPoint (Vector3 Vector)
		{
			return new Point((int)Vector.X, (int)Vector.Y);
		}

		/// <summary>
		/// Konvertiert einen Microsoft.Xna.Framework.Vector3 in einen Microsoft.Xna.Framework.Vector2, indem die Z-Komponente ignoriert wird.
		/// </summary>
		/// <param name="Vector">Der zu konvertierende Microsoft.Xna.Framework.Vector3.</param>
		/// <returns></returns>
		internal static Vector2 Vector3ToVector2 (Vector3 Vector)
		{
			return new Vector2(Vector.X, Vector.Y);
		}
	}
}
